package model;

import java.sql.*;
import java.util.Date;
import dal.*;
import util.*;

public class CompanyModel implements IModel {

	public static class FieldNames {
		public static String Id = "Id";
		public static String Code = "Code";
		public static String IsCompetitor = "IsCompetitor";
		public static String AbbName = "AbbName";
		public static String ShortName = "ShortName";
		public static String FullName = "FullName";
		public static String ForeignName = "ForeignName";
		public static String Address = "Address";
		public static String Telephone = "Telephone";
		public static String Fax = "Fax";
		public static String TaxCode = "TaxCode";
		public static String Remark = "Remark";
		public static String ContactPerson1 = "ContactPerson1";
		public static String ContactPhone1 = "ContactPhone1";
		public static String ContactMobile1 = "ContactMobile1";
		public static String ContactEmail1 = "ContactEmail1";
		public static String ContactPerson2 = "ContactPerson2";
		public static String ContactPhone2 = "ContactPhone2";
		public static String ContactMobile2 = "ContactMobile2";
		public static String ContactEmail2 = "ContactEmail2";
		public static String IdPlace = "IdPlace";
		public static String MapObject = "MapObject";
		public static String MapFile = "MapFile";
		public static String MapPath = "MapPath";
		public static String Description = "Description";
		public static String Status = "Status";
		public static String IsDraft = "IsDraft";
		public static String Notification = "Notification";
		public static String Created = "Created";
		public static String Creator = "Creator";
		public static String Updated = "Updated";
		public static String Updator = "Updator";
		public static String Deleted = "Deleted";
		public static String DeletionTime = "DeletionTime";
		
		public static String IsProvider = "IsProvider";
		public static String IsClient = "IsClient";
		public static String IsBroker = "IsProker";
	}

	public class ErrorMessages {
		public String Id = "";
		public String Code = "";
		public String IsCompetitor = "";
		public String AbbName = "";
		public String ShortName = "";
		public String FullName = "";
		public String ForeignName = "";
		public String Address = "";
		public String Telephone = "";
		public String Fax = "";
		public String TaxCode = "";
		public String Remark = "";
		public String ContactPerson1 = "";
		public String ContactPhone1 = "";
		public String ContactMobile1 = "";
		public String ContactEmail1 = "";
		public String ContactPerson2 = "";
		public String ContactPhone2 = "";
		public String ContactMobile2 = "";
		public String ContactEmail2 = "";
		public String IdPlace = "";
		public String MapObject = "";
		public String MapFile = "";
		public String MapPath = "";
		public String Description = "";
		public String Status = "";
		public String IsDraft = "";
		public String Notification = "";
		public String Created = "";
		public String Creator = "";
		public String Updated = "";
		public String Updator = "";
		public String Deleted = "";
		public String DeletionTime = "";
		public String IsProvider = "";
		public String IsClient = "";
		public String IsBroker = "";
	
	}

    public ErrorMessages errMsgs = new ErrorMessages();

	public String[] errMsgList = null;

// private variables
	private int _id = Integer.MIN_VALUE;
	private String _code = null;
	private boolean _is_competitor = false;
	private boolean _isis_competitorSet = false;
	private String _abb_name = null;
	private String _short_name = null;
	private String _full_name = null;
	private String _foreign_name = null;
	private String _address = null;
	private String _telephone = null;
	private String _fax = null;
	private String _tax_code = null;
	private String _remark = null;
	private String _contact_person_1 = null;
	private String _contact_phone_1 = null;
	private String _contact_mobile_1 = null;
	private String _contact_email_1 = null;
	private String _contact_person_2 = null;
	private String _contact_phone_2 = null;
	private String _contact_mobile_2 = null;
	private String _contact_email_2 = null;
	private int _id_place = Integer.MIN_VALUE;
	private String _map_object = null;
	private String _map_file = null;
	private String _map_path = null;
	private String _description = null;
	private int _status = Integer.MIN_VALUE;
	private boolean _is_draft = false;
	private boolean _isis_draftSet = false;
	private int _notification = Integer.MIN_VALUE;
	private Date _created = null;
	private int _creator = Integer.MIN_VALUE;
	private Date _updated = null;
	private int _updator = Integer.MIN_VALUE;
	private boolean _deleted = false;
	private boolean _isdeletedSet = false;
	private Date _deletion_time = null;
	
	public boolean _is_provider = false;
	private boolean _isis_providerSet = false;
	public boolean _is_client = false;
	private boolean _isis_clientSet = false;
	public boolean _is_broker = false;
	private boolean _isis_brokerSet = false;
	


	public CompanyModel() {
	}

// get/set
public int getId() {
		return _id;
	}
public void setId(int value) {
		_id = value;
	}
public String getIdToString() {
		if (_id == Integer.MIN_VALUE
				|| _id == Integer.MAX_VALUE) {
			return "";
		} else {
			return Integer.toString(_id);
		}
	}
public String getCode() {
	return _code;
}
public void setCode(String value) {
	_code = value;
}
public String getCodeToString() {
	if (_code != null) {
		return HtmlUtil.genHtml(_code);
	} else {
		return "";
	}
}
public boolean getIsCompetitor() {
		return _is_competitor;
	}
public void setIsCompetitor(boolean value) {
		_is_competitor = value;
		_isis_competitorSet = true;
	}
public boolean getIsCompetitorSet() {
		return _isis_competitorSet;
	}
public void setIsCompetitorSet(boolean value) {
	_isis_competitorSet = value;
}
	public String getIsCompetitorToString() {
		if (_isis_competitorSet) {
			return HtmlUtil.genHtml(_is_competitor);
		} else {
			return "";
		}
	}
public String getAbbName() {
		return _abb_name;
	}
public void setAbbName(String value) {
		_abb_name = value;
	}
public String getAbbNameToString() {
		if (_abb_name != null) {
			return HtmlUtil.genHtml(_abb_name);
		} else {
			return "";
		}
	}
public String getShortName() {
		return _short_name;
	}
public void setShortName(String value) {
		_short_name = value;
	}
public String getShortNameToString() {
		if (_short_name != null) {
			return HtmlUtil.genHtml(_short_name);
		} else {
			return "";
		}
	}
public String getFullName() {
		return _full_name;
	}
public void setFullName(String value) {
		_full_name = value;
	}
public String getFullNameToString() {
		if (_full_name != null) {
			return HtmlUtil.genHtml(_full_name);
		} else {
			return "";
		}
	}
public String getForeignName() {
		return _foreign_name;
	}
public void setForeignName(String value) {
		_foreign_name = value;
	}
public String getForeignNameToString() {
		if (_foreign_name != null) {
			return HtmlUtil.genHtml(_foreign_name);
		} else {
			return "";
		}
	}
public String getAddress() {
		return _address;
	}
public void setAddress(String value) {
		_address = value;
	}
public String getAddressToString() {
		if (_address != null) {
			return HtmlUtil.genHtml(_address);
		} else {
			return "";
		}
	}
public String getTelephone() {
		return _telephone;
	}
public void setTelephone(String value) {
		_telephone = value;
	}
public String getTelephoneToString() {
		if (_telephone != null) {
			return HtmlUtil.genHtml(_telephone);
		} else {
			return "";
		}
	}
public String getFax() {
	return _fax;
}
public void setFax(String value) {
	_fax = value;
}
public String getFaxToString() {
	if (_fax != null) {
		return HtmlUtil.genHtml(_fax);
	} else {
		return "";
	}
}
public String getTaxCode() {
		return _tax_code;
	}
public void setTaxCode(String value) {
		_tax_code = value;
	}
public String getTaxCodeToString() {
		if (_tax_code != null) {
			return HtmlUtil.genHtml(_tax_code);
		} else {
			return "";
		}
	}

public String getRemark() {
	return _remark;
}
public void setRemark(String value) {
	_remark = value;
}
public String getRemarkToString() {
	if (_remark != null) {
		return HtmlUtil.genHtml(_remark);
	} else {
		return "";
	}
}

public String getContactPerson1() {
	return _contact_person_1;
}
public void setContactPerson1(String value) {
	_contact_person_1 = value;
}
public String getContactPerson1ToString() {
	if (_contact_person_1 != null) {
		return HtmlUtil.genHtml(_contact_person_1);
	} else {
		return "";
	}
}

public String getContactPhone1() {
	return _contact_phone_1;
}
public void setContactPhone1(String value) {
	_contact_phone_1 = value;
}
public String getContactPhone1ToString() {
	if (_contact_phone_1 != null) {
		return HtmlUtil.genHtml(_contact_phone_1);
	} else {
		return "";
	}
}
public String getContactMobile1() {
	return _contact_mobile_1;
}
public void setContactMobile1(String value) {
	_contact_mobile_1 = value;
}
public String getContactMobile1ToString() {
	if (_contact_mobile_1 != null) {
		return HtmlUtil.genHtml(_contact_mobile_1);
	} else {
		return "";
	}
}
public String getContactEmail1() {
	return _contact_email_1;
}
public void setContactEmail1(String value) {
	_contact_email_1 = value;
}
public String getContactEmail1ToString() {
	if (_contact_email_1 != null) {
		return HtmlUtil.genHtml(_contact_email_1);
	} else {
		return "";
	}
}

public String getContactPerson2() {
	return _contact_person_2;
}
public void setContactPerson2(String value) {
	_contact_person_2 = value;
}
public String getContactPerson2ToString() {
	if (_contact_person_2 != null) {
		return HtmlUtil.genHtml(_contact_person_2);
	} else {
		return "";
	}
}

public String getContactPhone2() {
	return _contact_phone_2;
}
public void setContactPhone2(String value) {
	_contact_phone_2 = value;
}
public String getContactPhone2ToString() {
	if (_contact_phone_2 != null) {
		return HtmlUtil.genHtml(_contact_phone_2);
	} else {
		return "";
	}
}
public String getContactMobile2() {
	return _contact_mobile_2;
}
public void setContactMobile2(String value) {
	_contact_mobile_2 = value;
}
public String getContactMobile2ToString() {
	if (_contact_mobile_2 != null) {
		return HtmlUtil.genHtml(_contact_mobile_2);
	} else {
		return "";
	}
}
public String getContactEmail2() {
	return _contact_email_2;
}
public void setContactEmail2(String value) {
	_contact_email_2 = value;
}
public String getContactEmail2ToString() {
	if (_contact_email_2 != null) {
		return HtmlUtil.genHtml(_contact_email_2);
	} else {
		return "";
	}
}
public int getIdPlace() {
	return _id_place;
}
public void setIdPlace(int value) {
	_id_place = value;
}
public String getIdPlaceToString() {
	if (_id_place == Integer.MIN_VALUE
			|| _id_place == Integer.MAX_VALUE) {
		return "";
	} else {
		return Integer.toString(_id_place);
	}
}
public String getMapObject() {
	return _map_object;
}
public void setMapObject(String value) {
	_map_object = value;
}
public String getMapObjectToString() {
	if (_map_object != null) {
		return HtmlUtil.genHtml(_map_object);
	} else {
		return "";
	}
}
public String getMapFile() {
	return _map_file;
}
public void setMapFile(String value) {
	_map_file = value;
}
public String getMapFileToString() {
	if (_map_file != null) {
		return HtmlUtil.genHtml(_map_file);
	} else {
		return "";
	}
}
public String getMapPath() {
	return _map_path;
}
public void setMapPath(String value) {
	_map_path = value;
}
public String getMapPathToString() {
	if (_map_path != null) {
		return HtmlUtil.genHtml(_map_path);
	} else {
		return "";
	}
}

public String getDescription() {
		return _description;
	}
public void setDescription(String value) {
		_description = value;
	}
public String getDescriptionToString() {
		if (_description != null) {
			return HtmlUtil.genHtml(_description);
		} else {
			return "";
		}
	}
public int getStatus() {
		return _status;
	}
public void setStatus(int value) {
		_status = value;
	}
public String getStatusToString() {
		if (_status == Integer.MIN_VALUE
				|| _status == Integer.MAX_VALUE) {
			return "";
		} else {
			return Integer.toString(_status);
		}
	}
public boolean getIsDraft() {
		return _is_draft;
	}
public void setIsDraft(boolean value) {
		_is_draft = value;
		_isis_draftSet = true;
	}
public boolean getIsDraftSet() {
		return _isis_draftSet;
	}
	public String getIsDraftToString() {
		if (_isis_draftSet) {
			return HtmlUtil.genHtml(_is_draft);
		} else {
			return "";
		}
	}
public int getNotification() {
		return _notification;
	}
public void setNotification(int value) {
		_notification = value;
	}
public String getNotificationToString() {
		if (_notification == Integer.MIN_VALUE
				|| _notification == Integer.MAX_VALUE) {
			return "";
		} else {
			return Integer.toString(_notification);
		}
	}
public Date getCreated() {
		return _created;
	}
public void setCreated(Date value) {
		_created = value;
	}
public String getCreatedToString() {
		if (_created != null) {
			return StringUtil.toDateTimeString(_created);
		} else {
			return "";
		}
	}
public int getCreator() {
		return _creator;
	}
public void setCreator(int value) {
		_creator = value;
	}
public String getCreatorToString() {
		if (_creator == Integer.MIN_VALUE
				|| _creator == Integer.MAX_VALUE) {
			return "";
		} else {
			return Integer.toString(_creator);
		}
	}
public Date getUpdated() {
		return _updated;
	}
public void setUpdated(Date value) {
		_updated = value;
	}
public String getUpdatedToString() {
		if (_updated != null) {
			return StringUtil.toDateTimeString(_updated);
		} else {
			return "";
		}
	}
public int getUpdator() {
		return _updator;
	}
public void setUpdator(int value) {
		_updator = value;
	}
public String getUpdatorToString() {
		if (_updator == Integer.MIN_VALUE
				|| _updator == Integer.MAX_VALUE) {
			return "";
		} else {
			return Integer.toString(_updator);
		}
	}
public boolean getDeleted() {
		return _deleted;
	}
public void setDeleted(boolean value) {
		_deleted = value;
		_isdeletedSet = true;
	}
public boolean getDeletedSet() {
		return _isdeletedSet;
	}
	public String getDeletedToString() {
		if (_isdeletedSet) {
			return HtmlUtil.genHtml(_deleted);
		} else {
			return "";
		}
	}
public Date getDeletionTime() {
		return _deletion_time;
	}
public void setDeletionTime(Date value) {
		_deletion_time = value;
	}
public String getDeletionTimeToString() {
		if (_deletion_time != null) {
			return StringUtil.toDateTimeString(_deletion_time);
		} else {
			return "";
		}
	}

public boolean getIsProvider() {
	return _is_provider;
}
public void setIsProvider(boolean value) {
	_is_provider = value;
	_isis_providerSet = true;
}
public boolean getIsProviderSet() {
	return _isis_providerSet;
}
public void setIsProviderSet(boolean value) {
	_isis_providerSet = value;
}
public String getIsProviderToString() {
	if (_isis_providerSet) {
		return HtmlUtil.genHtml(_is_provider);
	} else {
		return "";
	}
}

public boolean getIsClient() {
	return _is_client;
}
public void setIsClient(boolean value) {
	_is_client = value;
	_isis_clientSet = true;
}
public boolean getIsClientSet() {
	return _isis_clientSet;
}
public void setIsClientSet(boolean value) {
	_isis_clientSet = value;
}
public String getIsClientToString() {
	if (_isis_clientSet) {
		return HtmlUtil.genHtml(_is_client);
	} else {
		return "";
	}
}
public boolean getIsBroker() {
	return _is_broker;
}
public void setIsBroker(boolean value) {
	_is_broker = value;
	_isis_brokerSet = true;
}
public boolean getIsBrokerSet() {
	return _isis_brokerSet;
}
public void setIsBrokerSet(boolean value) {
	_isis_brokerSet = value;
}
public String getIsBrokerToString() {
	if (_isis_brokerSet) {
		return HtmlUtil.genHtml(_is_broker);
	} else {
		return "";
	}
}

// implement method
public String getName() {
	return _short_name;
}

	@Override
	public int[] getPrimaryKey() {
		int[] ids = new int[1];
		ids[0] = getId();
		return ids;
	}

	@Override
	public IModel readFromResultSet(ResultSet rs) throws SQLException {
		CompanyModel model = null;

			model = new CompanyModel();

// read fields
{
				int value = rs.getInt("id");
				if (!rs.wasNull()) {
					model.setId(value);
				}
			}
{
	String value = rs.getString("code");
	if (!rs.wasNull()) {
		model.setCode(value);
	}
}
{
				boolean value = rs.getBoolean("is_competitor");
				if (!rs.wasNull()) {
					model.setIsCompetitor(value);
				}
			}
{
				String value = rs.getString("abb_name");
				if (!rs.wasNull()) {
					model.setAbbName(value);
				}
			}
{
				String value = rs.getString("short_name");
				if (!rs.wasNull()) {
					model.setShortName(value);
				}
			}
{
				String value = rs.getString("full_name");
				if (!rs.wasNull()) {
					model.setFullName(value);
				}
			}
{
				String value = rs.getString("foreign_name");
				if (!rs.wasNull()) {
					model.setForeignName(value);
				}
			}
{
				String value = rs.getString("address");
				if (!rs.wasNull()) {
					model.setAddress(value);
				}
			}
{
				String value = rs.getString("telephone");
				if (!rs.wasNull()) {
					model.setTelephone(value);
				}
			}
{
				String value = rs.getString("fax");
				if (!rs.wasNull()) {
					model.setFax(value);
				}
			}
{
				String value = rs.getString("tax_code");
				if (!rs.wasNull()) {
					model.setTaxCode(value);
				}
			}
{
	String value = rs.getString("remark");
	if (!rs.wasNull()) {
		model.setRemark(value);
	}
}
{
	String value = rs.getString("contact_person_1");
	if (!rs.wasNull()) {
		model.setContactPerson1(value);
	}
}
{
	String value = rs.getString("contact_phone_1");
	if (!rs.wasNull()) {
		model.setContactPhone1(value);
	}
}
{
	String value = rs.getString("contact_mobile_1");
	if (!rs.wasNull()) {
		model.setContactMobile1(value);
	}
}
{
	String value = rs.getString("contact_email_1");
	if (!rs.wasNull()) {
		model.setContactEmail1(value);
	}
}
{
	String value = rs.getString("contact_person_2");
	if (!rs.wasNull()) {
		model.setContactPerson2(value);
	}
}
{
	String value = rs.getString("contact_phone_2");
	if (!rs.wasNull()) {
		model.setContactPhone2(value);
	}
}
{
	String value = rs.getString("contact_mobile_2");
	if (!rs.wasNull()) {
		model.setContactMobile2(value);
	}
}
{
	String value = rs.getString("contact_email_2");
	if (!rs.wasNull()) {
		model.setContactEmail2(value);
	}
}
{
	int value = rs.getInt("id_place");
	if (!rs.wasNull()) {
		model.setIdPlace(value);
	}
}
// will modify later
{
	
	if (!rs.wasNull()) {
		model.setMapObject("");
	}
}
{
	
	if (!rs.wasNull()) {
		model.setMapFile("");
	}
}
{
	String value = rs.getString("map_path");
	if (!rs.wasNull()) {
		model.setMapPath(value);
	}
}
{
				String value = rs.getString("description");
				if (!rs.wasNull()) {
					model.setDescription(value);
				}
			}
{
				int value = rs.getInt("status");
				if (!rs.wasNull()) {
					model.setStatus(value);
				}
			}
{
				boolean value = rs.getBoolean("is_draft");
				if (!rs.wasNull()) {
					model.setIsDraft(value);
				}
			}
{
				int value = rs.getInt("notification");
				if (!rs.wasNull()) {
					model.setNotification(value);
				}
			}
{
				Date value = rs.getTimestamp("created");
				if (!rs.wasNull()) {
					model.setCreated(value);
				}
			}
{
				int value = rs.getInt("creator");
				if (!rs.wasNull()) {
					model.setCreator(value);
				}
			}
{
				Date value = rs.getTimestamp("updated");
				if (!rs.wasNull()) {
					model.setUpdated(value);
				}
			}
{
				int value = rs.getInt("updator");
				if (!rs.wasNull()) {
					model.setUpdator(value);
				}
			}
{
				boolean value = rs.getBoolean("deleted");
				if (!rs.wasNull()) {
					model.setDeleted(value);
				}
			}
{
				Date value = rs.getTimestamp("deletion_time");
				if (!rs.wasNull()) {
					model.setDeletionTime(value);
				}
			}
{
	boolean value = rs.getBoolean("is_provider");
	if (!rs.wasNull()) {
		model.setIsProvider(value);
	}
}
{
	boolean value = rs.getBoolean("is_client");
	if (!rs.wasNull()) {
		model.setIsClient(value);
	}
}
{
	boolean value = rs.getBoolean("is_broker");
	if (!rs.wasNull()) {
		model.setIsBroker(value);
	}
}
		return model;
	}

	@Override
	public PreparedStatement genSelectStatement(Connection dbConn, IModel query)
			throws SQLException {
		String sql = "SELECT * FROM sp_company_select(:id);";
		NamedParameterPreparedStatement st = new NamedParameterPreparedStatement(
				dbConn, sql);

        CompanyModel obj = (CompanyModel )query;
		
// set parameters
st.setObject("id", obj.getId());


		return st.getPreparedStatement();
	}

	@Override
	public PreparedStatement genSelectListStatement(Connection dbConn,
			IModelExt query) throws SQLException {
		String sql = "SELECT * FROM sp_company_selectList(:limit, :offset, :id, :code,:is_competitor,:abb_name,:short_name,:full_name,:foreign_name,:address,:telephone,:fax,:tax_code,:remark,:contact_person_1,:contact_phone_1,:contact_mobile_1,:contact_email_1,:contact_person_2,:contact_phone_2,:contact_mobile_2,:contact_email_2,:id_place,:map_object,:map_file,:map_path,:description,:status,:is_draft,:notification,:createdFrom,:createdTo,:creator,:updatedFrom,:updatedTo,:updator,:deleted,:deletion_timeFrom,:deletion_timeTo,:is_provider,:is_client,:is_broker)";

		NamedParameterPreparedStatement st = new NamedParameterPreparedStatement(
				dbConn, sql);

		CompanyModelExt obj = (CompanyModelExt) query;

		if (obj.getLimit() != Integer.MIN_VALUE) {
			st.setObject("limit", obj.getLimit());
		}  else {
			st.setObject("limit", Integer.MAX_VALUE);
		}
		if (obj.getOffset() != Integer.MIN_VALUE) {
			st.setObject("offset", obj.getOffset());
		}  else {
			st.setObject("offset", 0);
		}

// set parameters
if (obj.getId() != Integer.MIN_VALUE) {
			st.setObject("id", obj.getId());
		} else {
            st.setObject("id", null);
}
if (obj.getCode() != null) {
	st.setObject("code", obj.getCode());
} else {
    st.setObject("code", null);
}
		if (obj.getIsCompetitorSet()) {
			st.setObject("is_competitor", obj.getIsCompetitor());
		} else {
            st.setObject("is_competitor", null);
}
if (obj.getAbbName() != null) {
			st.setObject("abb_name", obj.getAbbName());
		} else {
            st.setObject("abb_name", null);
}
if (obj.getShortName() != null) {
			st.setObject("short_name", obj.getShortName());
		} else {
            st.setObject("short_name", null);
}
if (obj.getFullName() != null) {
			st.setObject("full_name", obj.getFullName());
		} else {
            st.setObject("full_name", null);
}
if (obj.getForeignName() != null) {
			st.setObject("foreign_name", obj.getForeignName());
		} else {
            st.setObject("foreign_name", null);
}
if (obj.getAddress() != null) {
			st.setObject("address", obj.getAddress());
		} else {
            st.setObject("address", null);
}
if (obj.getTelephone() != null) {
			st.setObject("telephone", obj.getTelephone());
		} else {
            st.setObject("telephone", null);
}
if (obj.getFax() != null) {
	st.setObject("fax", obj.getFax());
} else {
    st.setObject("fax", null);
}
if (obj.getTaxCode() != null) {
			st.setObject("tax_code", obj.getTaxCode());
		} else {
            st.setObject("tax_code", null);
}
if (obj.getRemark() != null) {
	st.setObject("remark", obj.getRemark());
} else {
    st.setObject("remark", null);
}
if (obj.getContactPerson1() != null) {
	st.setObject("contact_person_1", obj.getContactPerson1());
} else {
    st.setObject("contact_person_1", null);
}
if (obj.getContactPhone1() != null) {
	st.setObject("contact_phone_1", obj.getContactPhone1());
} else {
    st.setObject("contact_phone_1", null);
}
if (obj.getContactMobile1() != null) {
	st.setObject("contact_mobile_1", obj.getContactMobile1());
} else {
    st.setObject("contact_mobile_1", null);
}
if (obj.getContactEmail1() != null) {
	st.setObject("contact_email_1", obj.getContactEmail1());
} else {
    st.setObject("contact_email_1", null);
}
if (obj.getContactPerson2() != null) {
	st.setObject("contact_person_2", obj.getContactPerson2());
} else {
    st.setObject("contact_person_2", null);
}
if (obj.getContactPhone2() != null) {
	st.setObject("contact_phone_2", obj.getContactPhone2());
} else {
    st.setObject("contact_phone_2", null);
}
if (obj.getContactMobile2() != null) {
	st.setObject("contact_mobile_2", obj.getContactMobile2());
} else {
    st.setObject("contact_mobile_2", null);
}
if (obj.getContactEmail2() != null) {
	st.setObject("contact_email_2", obj.getContactEmail2());
} else {
    st.setObject("contact_email_2", null);
}
if (obj.getIdPlace() != Integer.MIN_VALUE) {
	st.setObject("id_place", obj.getIdPlace());
} else {
    st.setObject("id_place", null);
}
// will modify later
st.setObject("map_object", null);
st.setObject("map_file", null);
if (obj.getMapPath() != null) {
	st.setObject("map_path", obj.getMapPath());
} else {
    st.setObject("map_path", null);
}

if (obj.getDescription() != null) {
			st.setObject("description", obj.getDescription());
		} else {
            st.setObject("description", null);
}
if (obj.getStatus() != Integer.MIN_VALUE) {
			st.setObject("status", obj.getStatus());
		} else {
            st.setObject("status", null);
}
		if (obj.getIsDraftSet()) {
			st.setObject("is_draft", obj.getIsDraft());
		} else {
            st.setObject("is_draft", null);
}
		
if (obj.getNotification() != Integer.MIN_VALUE) {
			st.setObject("notification", obj.getNotification());
		} else {
            st.setObject("notification", null);
}
if (obj.getCreatedFrom() != null) {
			st.setObject("createdFrom", obj.getCreatedFrom());
		} else {
			st.setObject("createdFrom", null);
		}
		if (obj.getCreatedTo() != null) {
			st.setObject("createdTo", obj.getCreatedTo());
		} else {
            st.setObject("createdTo", null);
}
if (obj.getCreator() != Integer.MIN_VALUE) {
			st.setObject("creator", obj.getCreator());
		} else {
            st.setObject("creator", null);
}
if (obj.getUpdatedFrom() != null) {
			st.setObject("updatedFrom", obj.getUpdatedFrom());
		} else {
			st.setObject("updatedFrom", null);
		}
		if (obj.getUpdatedTo() != null) {
			st.setObject("updatedTo", obj.getUpdatedTo());
		} else {
            st.setObject("updatedTo", null);
}
if (obj.getUpdator() != Integer.MIN_VALUE) {
			st.setObject("updator", obj.getUpdator());
		} else {
            st.setObject("updator", null);
}
		if (obj.getDeletedSet()) {
			st.setObject("deleted", obj.getDeleted());
		} else {
            st.setObject("deleted", null);
}
if (obj.getDeletionTimeFrom() != null) {
			st.setObject("deletion_timeFrom", obj.getDeletionTimeFrom());
		} else {
			st.setObject("deletion_timeFrom", null);
		}
		if (obj.getDeletionTimeTo() != null) {
			st.setObject("deletion_timeTo", obj.getDeletionTimeTo());
		} else {
            st.setObject("deletion_timeTo", null);
}
		if (obj.getIsProviderSet()) {
			st.setObject("is_provider", obj.getIsProvider());
		} else {
            st.setObject("is_provider", null);
}
		if (obj.getIsClientSet()) {
			st.setObject("is_client", obj.getIsClient());
		} else {
            st.setObject("is_client", null);
}
		if (obj.getIsBrokerSet()) {
			st.setObject("is_broker", obj.getIsBroker());
		} else {
            st.setObject("is_broker", null);
}

		return st.getPreparedStatement();
	}

	@Override
	public PreparedStatement genInsertStatement(Connection dbConn, IModel model)
			throws SQLException {
		String sql = "SELECT sp_company_insert( :code,:is_competitor,:abb_name,:short_name,:full_name,:foreign_name,:address,:telephone,:fax,:tax_code,:remark,:contact_person_1,:contact_phone_1,:contact_mobile_1,:contact_email_1,:contact_person_2,:contact_phone_2,:contact_mobile_2,:contact_email_2,:id_place,:map_object,:map_file,:map_path,:description,:status,:is_draft,:notification,:creator,:is_provider,:is_client,:is_broker)";
		NamedParameterPreparedStatement st = new NamedParameterPreparedStatement(
				dbConn, sql);

		CompanyModel obj = (CompanyModel) model;

		// set parameters here
		if (obj.getCode() != null) {
			st.setObject("code", obj.getCode());
		} else {
		    st.setObject("code", null);
		}
				if (obj.getIsCompetitorSet()) {
					st.setObject("is_competitor", obj.getIsCompetitor());
				} else {
		            st.setObject("is_competitor", null);
		}
		if (obj.getAbbName() != null) {
					st.setObject("abb_name", obj.getAbbName());
				} else {
		            st.setObject("abb_name", null);
		}
		if (obj.getShortName() != null) {
					st.setObject("short_name", obj.getShortName());
				} else {
		            st.setObject("short_name", null);
		}
		if (obj.getFullName() != null) {
					st.setObject("full_name", obj.getFullName());
				} else {
		            st.setObject("full_name", null);
		}
		if (obj.getForeignName() != null) {
					st.setObject("foreign_name", obj.getForeignName());
				} else {
		            st.setObject("foreign_name", null);
		}
		if (obj.getAddress() != null) {
					st.setObject("address", obj.getAddress());
				} else {
		            st.setObject("address", null);
		}
		if (obj.getTelephone() != null) {
					st.setObject("telephone", obj.getTelephone());
				} else {
		            st.setObject("telephone", null);
		}
		if (obj.getFax() != null) {
			st.setObject("fax", obj.getFax());
		} else {
		    st.setObject("fax", null);
		}
		if (obj.getTaxCode() != null) {
					st.setObject("tax_code", obj.getTaxCode());
				} else {
		            st.setObject("tax_code", null);
		}
		if (obj.getRemark() != null) {
			st.setObject("remark", obj.getRemark());
		} else {
		    st.setObject("remark", null);
		}
		if (obj.getContactPerson1() != null) {
			st.setObject("contact_person_1", obj.getContactPerson1());
		} else {
		    st.setObject("contact_person_1", null);
		}
		if (obj.getContactPhone1() != null) {
			st.setObject("contact_phone_1", obj.getContactPhone1());
		} else {
		    st.setObject("contact_phone_1", null);
		}
		if (obj.getContactMobile1() != null) {
			st.setObject("contact_mobile_1", obj.getContactMobile1());
		} else {
		    st.setObject("contact_mobile_1", null);
		}
		if (obj.getContactEmail1() != null) {
			st.setObject("contact_email_1", obj.getContactEmail1());
		} else {
		    st.setObject("contact_email_1", null);
		}
		if (obj.getContactPerson2() != null) {
			st.setObject("contact_person_2", obj.getContactPerson2());
		} else {
		    st.setObject("contact_person_2", null);
		}
		if (obj.getContactPhone2() != null) {
			st.setObject("contact_phone_2", obj.getContactPhone2());
		} else {
		    st.setObject("contact_phone_2", null);
		}
		if (obj.getContactMobile2() != null) {
			st.setObject("contact_mobile_2", obj.getContactMobile2());
		} else {
		    st.setObject("contact_mobile_2", null);
		}
		if (obj.getContactEmail2() != null) {
			st.setObject("contact_email_2", obj.getContactEmail2());
		} else {
		    st.setObject("contact_email_2", null);
		}
		if (obj.getIdPlace() != Integer.MIN_VALUE) {
			st.setObject("id_place", obj.getIdPlace());
		} else {
		    st.setObject("id_place", null);
		}
		// will modify later
		st.setObject("map_object", null);
		st.setObject("map_file", null);
		if (obj.getMapPath() != null) {
			st.setObject("map_path", obj.getMapPath());
		} else {
		    st.setObject("map_path", null);
		}

		if (obj.getDescription() != null) {
					st.setObject("description", obj.getDescription());
				} else {
		            st.setObject("description", null);
		}
		if (obj.getStatus() != Integer.MIN_VALUE) {
					st.setObject("status", obj.getStatus());
				} else {
		            st.setObject("status", null);
		}
				if (obj.getIsDraftSet()) {
					st.setObject("is_draft", obj.getIsDraft());
				} else {
		            st.setObject("is_draft", null);
		}
		if (obj.getNotification() != Integer.MIN_VALUE) {
					st.setObject("notification", obj.getNotification());
				} else {
		            st.setObject("notification", null);
		}
		
		if (obj.getCreator() != Integer.MIN_VALUE) {
					st.setObject("creator", obj.getCreator());
				} else {
		            st.setObject("creator", null);
		}
		if (obj.getIsProviderSet()) {
			st.setObject("is_provider", obj.getIsProvider());
		} else {
            st.setObject("is_provider", null);
}
		if (obj.getIsClientSet()) {
			st.setObject("is_client", obj.getIsClient());
		} else {
            st.setObject("is_client", null);
}
		if (obj.getIsBrokerSet()) {
			st.setObject("is_broker", obj.getIsBroker());
		} else {
            st.setObject("is_broker", null);
}

		return st.getPreparedStatement();
	}

	@Override
	public PreparedStatement genUpdateStatement(Connection dbConn, IModel model)
			throws SQLException {
		String sql = "SELECT sp_company_update(:id, :code,:is_competitor,:abb_name,:short_name,:full_name,:foreign_name,:address,:telephone,:fax,:tax_code,:remark,:contact_person_1,:contact_phone_1,:contact_mobile_1,:contact_email_1,:contact_person_2,:contact_phone_2,:contact_mobile_2,:contact_email_2,:id_place,:map_object,:map_file,:map_path,:description,:status,:is_draft,:notification,:updator,:deleted,:deletion_time,:is_provider,:is_client,:is_broker)";

		NamedParameterPreparedStatement st = new NamedParameterPreparedStatement(
				dbConn, sql);

		CompanyModel obj = (CompanyModel) model;

		// set parameters here
if (obj.getId() != Integer.MIN_VALUE) {
			st.setObject("id", obj.getId());
		} else {
			st.setObject("id", null);
}
if (obj.getCode() != null) {
	st.setObject("code", obj.getCode());
} else {
    st.setObject("code", null);
}
		if (obj.getIsCompetitorSet()) {
			st.setObject("is_competitor", obj.getIsCompetitor());
		} else {
            st.setObject("is_competitor", null);
}
if (obj.getAbbName() != null) {
			st.setObject("abb_name", obj.getAbbName());
		} else {
            st.setObject("abb_name", null);
}
if (obj.getShortName() != null) {
			st.setObject("short_name", obj.getShortName());
		} else {
            st.setObject("short_name", null);
}
if (obj.getFullName() != null) {
			st.setObject("full_name", obj.getFullName());
		} else {
            st.setObject("full_name", null);
}
if (obj.getForeignName() != null) {
			st.setObject("foreign_name", obj.getForeignName());
		} else {
            st.setObject("foreign_name", null);
}
if (obj.getAddress() != null) {
			st.setObject("address", obj.getAddress());
		} else {
            st.setObject("address", null);
}
if (obj.getTelephone() != null) {
			st.setObject("telephone", obj.getTelephone());
		} else {
            st.setObject("telephone", null);
}
if (obj.getFax() != null) {
	st.setObject("fax", obj.getFax());
} else {
    st.setObject("fax", null);
}
if (obj.getTaxCode() != null) {
			st.setObject("tax_code", obj.getTaxCode());
		} else {
            st.setObject("tax_code", null);
}
if (obj.getRemark() != null) {
	st.setObject("remark", obj.getRemark());
} else {
    st.setObject("remark", null);
}
if (obj.getContactPerson1() != null) {
	st.setObject("contact_person_1", obj.getContactPerson1());
} else {
    st.setObject("contact_person_1", null);
}
if (obj.getContactPhone1() != null) {
	st.setObject("contact_phone_1", obj.getContactPhone1());
} else {
    st.setObject("contact_phone_1", null);
}
if (obj.getContactMobile1() != null) {
	st.setObject("contact_mobile_1", obj.getContactMobile1());
} else {
    st.setObject("contact_mobile_1", null);
}
if (obj.getContactEmail1() != null) {
	st.setObject("contact_email_1", obj.getContactEmail1());
} else {
    st.setObject("contact_email_1", null);
}
if (obj.getContactPerson2() != null) {
	st.setObject("contact_person_2", obj.getContactPerson2());
} else {
    st.setObject("contact_person_2", null);
}
if (obj.getContactPhone2() != null) {
	st.setObject("contact_phone_2", obj.getContactPhone2());
} else {
    st.setObject("contact_phone_2", null);
}
if (obj.getContactMobile2() != null) {
	st.setObject("contact_mobile_2", obj.getContactMobile2());
} else {
    st.setObject("contact_mobile_2", null);
}
if (obj.getContactEmail2() != null) {
	st.setObject("contact_email_2", obj.getContactEmail2());
} else {
    st.setObject("contact_email_2", null);
}
if (obj.getIdPlace() != Integer.MIN_VALUE) {
	st.setObject("id_place", obj.getIdPlace());
} else {
    st.setObject("id_place", null);
}
// will modify later
st.setObject("map_object", null);
st.setObject("map_file", null);
if (obj.getMapPath() != null) {
	st.setObject("map_path", obj.getMapPath());
} else {
    st.setObject("map_path", null);
}
if (obj.getDescription() != null) {
			st.setObject("description", obj.getDescription());
		} else {
			st.setObject("description", null);
}
if (obj.getStatus() != Integer.MIN_VALUE) {
			st.setObject("status", obj.getStatus());
		} else {
			st.setObject("status", null);
}
		if (obj.getIsDraftSet()) {
			st.setObject("is_draft", obj.getIsDraft());
		} else {
			st.setObject("is_draft", null);
}
if (obj.getNotification() != Integer.MIN_VALUE) {
			st.setObject("notification", obj.getNotification());
		} else {
			st.setObject("notification", null);
}
if (obj.getUpdator() != Integer.MIN_VALUE) {
			st.setObject("updator", obj.getUpdator());
		} else {
			st.setObject("updator", null);
}
		if (obj.getDeletedSet()) {
			st.setObject("deleted", obj.getDeleted());
		} else {
			st.setObject("deleted", null);
}
if (obj.getDeletionTime() != null) {
			st.setObject("deletion_time", obj.getDeletionTime());
		} else {
			st.setObject("deletion_time", null);
}
if (obj.getIsProviderSet()) {
	st.setObject("is_provider", obj.getIsProvider());
} else {
    st.setObject("is_provider", null);
}
if (obj.getIsClientSet()) {
	st.setObject("is_client", obj.getIsClient());
} else {
    st.setObject("is_client", null);
}
if (obj.getIsBrokerSet()) {
	st.setObject("is_broker", obj.getIsBroker());
} else {
    st.setObject("is_broker", null);
}
	
		return st.getPreparedStatement();
	}

	@Override
	public PreparedStatement genDeleteStatement(Connection dbConn, IModel query)
			throws SQLException {
		String sql = "select sp_company_delete(:id);";
		NamedParameterPreparedStatement st = new NamedParameterPreparedStatement(
				dbConn, sql);

        CompanyModel obj = (CompanyModel) query;

		// set primary keys
st.setObject("id", obj.getId());


		return st.getPreparedStatement();
	}

	@Override
	public PreparedStatement genCountStatement(Connection dbConn,
			IModelExt input) throws SQLException {
		String sql = "SELECT sp_company_count(:id, :code,:is_competitor,:abb_name,:short_name,:full_name,:foreign_name,:address,:telephone,:fax,:tax_code,:remark,:contact_person_1,:contact_phone_1,:contact_mobile_1,:contact_email_1,:contact_person_2,:contact_phone_2,:contact_mobile_2,:contact_email_2,:id_place,:map_object,:map_file,:map_path,:description,:status,:is_draft,:notification,:createdFrom,:createdTo,:creator,:updatedFrom,:updatedTo,:updator,:deleted,:deletion_timeFrom,:deletion_timeTo,:is_provider,:is_client,:is_broker)";

		NamedParameterPreparedStatement st = new NamedParameterPreparedStatement(
				dbConn, sql);

		CompanyModelExt obj = (CompanyModelExt) input;

		// set parameters here
		if (obj.getId() != Integer.MIN_VALUE) {
			st.setObject("id", obj.getId());
		} else {
			st.setObject("id", null);
}
if (obj.getCode() != null) {
	st.setObject("code", obj.getCode());
} else {
    st.setObject("code", null);
}
		if (obj.getIsCompetitorSet()) {
			st.setObject("is_competitor", obj.getIsCompetitor());
		} else {
            st.setObject("is_competitor", null);
}
if (obj.getAbbName() != null) {
			st.setObject("abb_name", obj.getAbbName());
		} else {
            st.setObject("abb_name", null);
}
if (obj.getShortName() != null) {
			st.setObject("short_name", obj.getShortName());
		} else {
            st.setObject("short_name", null);
}
if (obj.getFullName() != null) {
			st.setObject("full_name", obj.getFullName());
		} else {
            st.setObject("full_name", null);
}
if (obj.getForeignName() != null) {
			st.setObject("foreign_name", obj.getForeignName());
		} else {
            st.setObject("foreign_name", null);
}
if (obj.getAddress() != null) {
			st.setObject("address", obj.getAddress());
		} else {
            st.setObject("address", null);
}
if (obj.getTelephone() != null) {
			st.setObject("telephone", obj.getTelephone());
		} else {
            st.setObject("telephone", null);
}
if (obj.getFax() != null) {
	st.setObject("fax", obj.getFax());
} else {
    st.setObject("fax", null);
}
if (obj.getTaxCode() != null) {
			st.setObject("tax_code", obj.getTaxCode());
		} else {
            st.setObject("tax_code", null);
}
if (obj.getRemark() != null) {
	st.setObject("remark", obj.getRemark());
} else {
    st.setObject("remark", null);
}
if (obj.getContactPerson1() != null) {
	st.setObject("contact_person_1", obj.getContactPerson1());
} else {
    st.setObject("contact_person_1", null);
}
if (obj.getContactPhone1() != null) {
	st.setObject("contact_phone_1", obj.getContactPhone1());
} else {
    st.setObject("contact_phone_1", null);
}
if (obj.getContactMobile1() != null) {
	st.setObject("contact_mobile_1", obj.getContactMobile1());
} else {
    st.setObject("contact_mobile_1", null);
}
if (obj.getContactEmail1() != null) {
	st.setObject("contact_email_1", obj.getContactEmail1());
} else {
    st.setObject("contact_email_1", null);
}
if (obj.getContactPerson2() != null) {
	st.setObject("contact_person_2", obj.getContactPerson2());
} else {
    st.setObject("contact_person_2", null);
}
if (obj.getContactPhone2() != null) {
	st.setObject("contact_phone_2", obj.getContactPhone2());
} else {
    st.setObject("contact_phone_2", null);
}
if (obj.getContactMobile2() != null) {
	st.setObject("contact_mobile_2", obj.getContactMobile2());
} else {
    st.setObject("contact_mobile_2", null);
}
if (obj.getContactEmail2() != null) {
	st.setObject("contact_email_2", obj.getContactEmail2());
} else {
    st.setObject("contact_email_2", null);
}
if (obj.getIdPlace() != Integer.MIN_VALUE) {
	st.setObject("id_place", obj.getIdPlace());
} else {
    st.setObject("id_place", null);
}
// will modify later
st.setObject("map_object", null);
st.setObject("map_file", null);
if (obj.getMapPath() != null) {
	st.setObject("map_path", obj.getMapPath());
} else {
    st.setObject("map_path", null);
}
if (obj.getDescription() != null) {
			st.setObject("description", obj.getDescription());
		} else {
            st.setObject("description", null);
}
if (obj.getStatus() != Integer.MIN_VALUE) {
			st.setObject("status", obj.getStatus());
		} else {
            st.setObject("status", null);
}
		if (obj.getIsDraftSet()) {
			st.setObject("is_draft", obj.getIsDraft());
		} else {
            st.setObject("is_draft", null);
}
if (obj.getNotification() != Integer.MIN_VALUE) {
			st.setObject("notification", obj.getNotification());
		} else {
            st.setObject("notification", null);
}
if (obj.getCreatedFrom() != null) {
			st.setObject("createdFrom", obj.getCreatedFrom());
		} else {
			st.setObject("createdFrom", null);
		}
		if (obj.getCreatedTo() != null) {
			st.setObject("createdTo", obj.getCreatedTo());
		} else {
            st.setObject("createdTo", null);
}
if (obj.getCreator() != Integer.MIN_VALUE) {
			st.setObject("creator", obj.getCreator());
		} else {
            st.setObject("creator", null);
}
if (obj.getUpdatedFrom() != null) {
			st.setObject("updatedFrom", obj.getUpdatedFrom());
		} else {
			st.setObject("updatedFrom", null);
		}
		if (obj.getUpdatedTo() != null) {
			st.setObject("updatedTo", obj.getUpdatedTo());
		} else {
            st.setObject("updatedTo", null);
}
if (obj.getUpdator() != Integer.MIN_VALUE) {
			st.setObject("updator", obj.getUpdator());
		} else {
            st.setObject("updator", null);
}
		if (obj.getDeletedSet()) {
			st.setObject("deleted", obj.getDeleted());
		} else {
            st.setObject("deleted", null);
}
if (obj.getDeletionTimeFrom() != null) {
			st.setObject("deletion_timeFrom", obj.getDeletionTimeFrom());
		} else {
			st.setObject("deletion_timeFrom", null);
		}
		if (obj.getDeletionTimeTo() != null) {
			st.setObject("deletion_timeTo", obj.getDeletionTimeTo());
		} else {
            st.setObject("deletion_timeTo", null);
}
		if (obj.getIsProviderSet()) {
			st.setObject("is_provider", obj.getIsProvider());
		} else {
            st.setObject("is_provider", null);
}
		if (obj.getIsClientSet()) {
			st.setObject("is_client", obj.getIsClient());
		} else {
            st.setObject("is_client", null);
}
		if (obj.getIsBrokerSet()) {
			st.setObject("is_broker", obj.getIsBroker());
		} else {
            st.setObject("is_broker", null);
}
	
		return st.getPreparedStatement();
	}

/*
	private String fillHtmlTemplate(String template) {
		String html = template
				.replace(":id", Integer.toString(_id))
.replace(":is_competitor", HtmlUtil.genHtml(_isis_competitorSet, _is_competitor))
.replace(":abb_name", HtmlUtil.genHtml(_abb_name))
.replace(":short_name", HtmlUtil.genHtml(_short_name))
.replace(":full_name", HtmlUtil.genHtml(_full_name))
.replace(":foreign_name", HtmlUtil.genHtml(_foreign_name))
.replace(":address", HtmlUtil.genHtml(_address))
.replace(":mobile", HtmlUtil.genHtml(_mobile))
.replace(":tax_code", HtmlUtil.genHtml(_tax_code))
.replace(":description", HtmlUtil.genHtml(_description))
.replace(":status", Integer.toString(_status))
.replace(":is_draft", HtmlUtil.genHtml(_isis_draftSet, _is_draft))
.replace(":notification", Integer.toString(_notification))
.replace(":created", StringUtil.toDateTimeString(_created))
.replace(":creator", Integer.toString(_creator))
.replace(":updated", StringUtil.toDateTimeString(_updated))
.replace(":updator", Integer.toString(_updator))
.replace(":deleted", HtmlUtil.genHtml(_isdeletedSet, _deleted))
.replace(":deletion_time", StringUtil.toDateTimeString(_deletion_time))

				;
		return html;
	}
*/

/*
	private String fillHtmlTemplate(String template) {
		String html = template
				.replace(":Id", Integer.toString(_Id))
.replace(":IsCompetitor", HtmlUtil.genHtml(_isIsCompetitorSet, _IsCompetitor))
.replace(":AbbName", HtmlUtil.genHtml(_AbbName))
.replace(":ShortName", HtmlUtil.genHtml(_ShortName))
.replace(":FullName", HtmlUtil.genHtml(_FullName))
.replace(":ForeignName", HtmlUtil.genHtml(_ForeignName))
.replace(":Address", HtmlUtil.genHtml(_Address))
.replace(":Mobile", HtmlUtil.genHtml(_Mobile))
.replace(":TaxCode", HtmlUtil.genHtml(_TaxCode))
.replace(":Description", HtmlUtil.genHtml(_Description))
.replace(":Status", Integer.toString(_Status))
.replace(":IsDraft", HtmlUtil.genHtml(_isIsDraftSet, _IsDraft))
.replace(":Notification", Integer.toString(_Notification))
.replace(":Created", StringUtil.toDateTimeString(_Created))
.replace(":Creator", Integer.toString(_Creator))
.replace(":Updated", StringUtil.toDateTimeString(_Updated))
.replace(":Updator", Integer.toString(_Updator))
.replace(":Deleted", HtmlUtil.genHtml(_isDeletedSet, _Deleted))
.replace(":DeletionTime", StringUtil.toDateTimeString(_DeletionTime))

				;
		return html;
	}
*/

}